package ltd.newbee.mall.config.constant;
// FlowType.java
public enum FlowType {
    LOCK(1, "订单预扣"),
    CONFIRM(2, "支付成功"),
    RESTORE(3, "取消归还");

    private final Integer code;
    private final String desc;

    FlowType(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static FlowType getByCode(Integer code) {
        for (FlowType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
}
